﻿using MaterialDesignColors;
using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ZhuXingFamilys.AuditIndicators
{
    /// <summary>
    /// AuditIndicators.xaml 的交互逻辑
    /// </summary>
    public partial class AuditIndicators : Window
    {
        private static AuditIndicators instance = null;
        public AuditIndicators()
        {
            //ui库使用
            ColorZoneAssist.SetMode(new GroupBox(), ColorZoneMode.Light);
            Hue hue = new Hue("name", System.Windows.Media.Color.FromArgb(1, 2, 3, 4),
                System.Windows.Media.Color.FromArgb(1, 5, 6, 7));
            InitializeComponent();
            //this.SizeChanged += AuditIndicators_SizeChanged;
        }
        // 尺寸变化
        private void AuditIndicators_SizeChanged(object sender, SizeChangedEventArgs e)
        {

        }

        public static AuditIndicators getInstance()
        {
            if (instance == null)
            {
                instance = new AuditIndicators();
            }
            return instance;
        }
        // 关闭
        private void AuditIndicators_OnClosed(object sender, EventArgs e)
        {
            instance = null;
        }

        // 加载完成
        private void AuditIndicators_OnLoaded(object sender, RoutedEventArgs e)
        {
            // 背景图片
            foreach (var item in MenuTabControl.Items)
            {
                var tabItem = item as TabItem;
                var border = tabItem.Content as Border;
                if (border != null)
                {
                    ImageBrush imageBrush = new ImageBrush();
                    string imagePath = "pack://application:,,,/ZhuXingFamilys;component/AuditIndicators/IMG/模型背景1.jpeg";
                    imageBrush.ImageSource = new BitmapImage(new Uri(imagePath, UriKind.RelativeOrAbsolute));
                    border.Background = imageBrush;
                }
            }

        }

        private void MenuTabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TabItem ti = MenuTabControl.SelectedItem as TabItem;
            if (ti != null && ti.Header.ToString() == "图模一致审核报告")
            {
                //WebBrowser.Navigate(new Uri(@"D:\雄安新区BIM图审平台体检单.pdf"));
            }
        }

        #region 审核指标数据获取



        #endregion
    }
}
